<div class="right_side_operate_area">
	<?php  
		$user=$session->read('User');
		$companyid=$session->read("companyid");
		$isflag=true;
	?>
	
	

	<div class="right_side_title left">
		<h2>
		<?php 
		$companyname=$session->read("companyname");
		echo $html->link($companyname,"/companys/showinfosummary/".$companyid);
		?>
		</h2>
		<div class="clear"></div>
	</div>

    <div class="clear"></div>
</div>

<!--No.1 取出企业人员信息 开始-->
<?php
	$compPeople = $objCompany["CompPerson"];
	$personcount=count($compPeople);
	$dr=0;
	$master=0;
	$graduate=0;
	$undergraduate=0;
	$college=0;
	$secondary=0;
	$is_technical=0;
	$is_rd=0;
	$is_stuoversea=0;
	$is_intern=0;
	$intern_days=0;
	$is_newgraduates=0;
	foreach($compPeople as $person)
	{
		$education=$person['education'];
		if($education=="1"){
			$dr++;
		}else if($education=="2"){
			$master++;
		}else if($education=="3"){
			$graduate++;
		}else if($education=="4"){
			$undergraduate++;
		}else if($education=="5"){
			$college++;
		}else if($education=="6"){
			$secondary++;
		}
		if($person['is_technical']){
			$is_technical++;
		}else if($person['is_rd']){
			$is_rd++;
		}else if($person['is_stuoversea']){
			$is_stuoversea++;
		}else if($person['is_intern']){
			$is_intern++;
			$intern_days+=$person['intern_days'];
		}else if($person['is_newgraduates']){
			$is_newgraduates++;
		}
	}
?>
<!--No.1 取出企业人员信息 结束-->
	
<!--No.2 取出企业经济指标信息 开始-->
<?php
	$compEconomic = $objCompany["CompEconomic"];
	$economicCount = count($compEconomic);
	//企业经济指标年份变量
	$economic_year = "";
	$year_num0 = 0;
	$year_num1 = 0;
	$year_num2 = 0;
	$year_num3 = 0;
	
	$years = $str->getafteryear(0);
	$now_year = date("Y",strtotime("now"));
	
	//企业经济指标的变量
	$general_income=0;
	$prospect=0;
	$net_profit=0;
	$over_taxes=0;
	$qcll=0;

	foreach($compEconomic as $economic)
	{
		$economic_year = $economic["company_year"];
		if($economic_year == $years[$now_year-3])
		{
			$year_num0++;
		}
		else if($economic_year == $years[$now_year-2])
		{
			$year_num1++;
		}else if($economic_year == $years[$now_year-1])
		{
			$year_num2++;
		}else if($economic_year == $years[$now_year])
		{
			$year_num3++;
		}
		
		//企业的一些经济指标的综合
		$general_income+=$economic["general_income"];
		$prospect+=$economic["prospect"];
		$net_profit+=$economic["net_profit"];
		$over_taxes+=$economic["over_taxes"];
		$qcll+=$economic["qcll"];
		
	}
?>
<!--No.2 取出企业经济指标信息 结束-->

<!--No.3 取出企业科技指标信息 开始-->
<?php
$companyPatent=$objCompany["CompanyPatent"];

/*取出企业专利项数 开始*/
$apply=0;
$applyinvent=0;
$authorize=0;
$authorizeinvent=0;
$buy=0;
foreach($companyPatent as $patent)
{
	$state=$patent['state'];
	$type_id=$patent['type_id'];
	if($state=="0")
	{
		$apply++;
		if($type_id==$invent)
		{
			$applyinvent++;
		}
	}
	if($state=="2")
	{
		$authorize++;
		if($type_id==$invent)
		{
			$authorizeinvent++;
		}
	}
	if($state=="3"){
		$buy++;
	}
}
/*取出企业专利项数 结束*/

/*取出企业科研经费 开始*/
$objcompdepcost=$objCompany["DevelopmentCost"];
$cost=0;
$research_exp=0;
$new_product=0;
$govern_funding=0;
$raised_enterprise=0;
foreach($objcompdepcost as $depcost)
{
	$cost+=$depcost["cost"];//总额
	$research_exp+=$depcost["research_exp"];//研究与试验发展支出
	$new_product+=$depcost["new_product"];//新产品开发支出
	$govern_funding+=$depcost["govern_funding"];//政府拨款
	$raised_enterprise+=$depcost["raised_enterprise"];//企业自筹
}
/*取出企业科研经费 结束*/
?>
<!--No.3 取出企业科技指标信息 结束-->

<!--No.4 取出企业人才项目 开始-->
<?php
	$compTalent = $objCompany["CompTalent"];
	$i = 0;
	$tnames = null;
	foreach($compTalent as $talent)
	{
		$tvalue=$talent['type_id'];
		classregistry::init('Talstack')->tname="";
		classregistry::init('Talstack')->showtname($tvalue);
		$tnames[$i]=rtrim(classregistry::init('Talstack')->tname,"/");
		$i++;
	}
	if(!empty($tnames))
	{
		$count_tname = array_count_values($tnames);//统计数组中出现的值的次数
		$all_tnames = array_keys($count_tname);//返回数组中所有的键名
	}
?>
<!--No.4 取出企业人才项目 结束-->


<div class="right_side_scollbar">
    <div class="detail_info_panel">
		<div>
			<div>人员信息</div>
			<div>
				<?php 
					$person_statement = "";
					$person_statement = "博士:".$dr."名  "."硕士:".$master."名  "."研究生:".$graduate."名  "."本科生:".$undergraduate."名  "."大专生:".$college."名  "."中专生:".$secondary."名  ";
					echo $person_statement;
					echo "<br/>";
					$person_statement = "科技活动人员数:".$is_technical."名  "."研究与发展人员数:".$is_rd."名  "."留学回国人员数:".$is_stuoversea."名  "."实习生实习天数:".$intern_days."天  "
					."应届生:".$is_newgraduates."名  ";
					echo $person_statement;
				?>
			</div>
			<div><?php echo $html->link("查看详情","/companys/person/"); ?></div>
		</div>
		<hr>
		
		<div>
			<div>经济指标</div>
			<div>
				<?php
					$economic_statement = "";
					$economic_statement = $years[$now_year-2]."年:".$year_num1."条  ".$years[$now_year-1]."年:".$year_num2."条  ".$years[$now_year]."年:".$year_num3."条";
					echo $economic_statement;
					echo "<br/>";
					$economic_statement = "总收入:".$general_income."￥ "."工业总产值:".$prospect."￥  "."净利润:".$net_profit."￥  "."上缴税金:".$over_taxes."￥  "."出口创汇:".$qcll."￥ ";
					echo $economic_statement;
				?>
			</div>
			<div><?php echo $html->link("查看详情","/companys/economic/"); ?></div>
		</div>
		<hr>
		
		<div>	
			<div>科技指标</div>
			<div>
				<?php
					$patent_statement = "";
					$patent_statement = "申请专利项数:".$apply."个  "."批准专利项数:".$authorize."个  "."购买专利项数:".$buy."个";
					echo $patent_statement;
					
					echo "<br/>";
					
					$cost_statement = "总额:".$cost."￥  "."研究与试验发展支出:".$research_exp."￥  "."新产品开发支出:".$new_product."￥  "."政府拨款:".$govern_funding."￥  "."企业自筹:".$raised_enterprise."￥  ";
					echo $cost_statement;
				?>
			</div>
			<div><?php echo $html->link("查看详情","/companys/patents/"); ?></div>
		</div>
		<hr>
		
		<div>	
			<div>人才项目指标</div>
			<div>
				<?php
					$talent_statement = "";
					if(!empty($all_tnames))
					{
						foreach($all_tnames as $talentname)
						{
							$talent_statement = $talent_statement.$talentname.":".$count_tname[$talentname]."个   ";
						}
					}
					else $talent_statement = "暂无人才项目";
					echo $talent_statement;
				?>
			</div>
			<div><?php echo $html->link("查看详情","/companys/talent/"); ?></div>
		</div>
		<hr>
		
		
		<div>
			<div>信息提醒</div>
			<div></div>
		</div>
		
    </div>
</div>